﻿namespace LearnMAUI2.Services;

public class RouteService : IRouteSerivice
{
    //非最优解
    private readonly Dictionary<string, string> _routeDictionary = new Dictionary<string, string>
    {
        //key和path都是TodayPage
        //pagekey "TodayPage" -> route "TodayPage"
        [RootNavigationConstant.TodayPage] = RootNavigationConstant.TodayPage,
        [RootNavigationConstant.QueryPage] = RootNavigationConstant.QueryPage,
        //pageKey "TodayDetailPage" -> route "TodayPage/TodayDetailPage"
        [ContentNavigationConstant.TodayDetailPage] = $"{RootNavigationConstant.TodayPage}/{ContentNavigationConstant.TodayDetailPage}",
        //TODO
        [ContentNavigationConstant.ResultPage] = ContentNavigationConstant.ResultPage,
        //TODO
        [ContentNavigationConstant.DetailPage] = $"{ContentNavigationConstant.ResultPage}/{ContentNavigationConstant.DetailPage}"
    };

    public string GeteRoute(string page) => _routeDictionary[page];
}
